/*
 * Led.cpp
 *
 *  Created on: 04.06.2014
 *      Author: matti
 */

#include "Led.hpp"

Led::Led(int p) :
		PIN(p) {
	pinMode(PIN, OUTPUT);
}

bool Led::isOn() const {
	return digitalRead(PIN);
}

void Led::on() {
	digitalWrite(PIN, HIGH);
}

void Led::off() {
	digitalWrite(PIN, LOW);
}

int Led::getPin() const {
	return PIN;
}

void Led::blink(int dur) {
	Led::on();
	delay(dur);
	Led::off();
}

